from core.basehandler import BaseHandler
from core.room import Room
from core.support import set_cutscene
from core.action import Action

class EmptyRoomTemplate(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # setup starting properties for the room
        ## Example:
        ## self.treasure_locked = True
        ## self.lock_rusty = True

        # add room items you can pick up
        ## Example:
        ## self.add_item(Keys())
        
        # build list of actions
        ## Example:
        ## self.add_action(Up)
        ## self.add_action(East)
        ## self.add_action(South)
    
    def get_description(self):
        desc = '''
        This is the room description you will display to the player!  
        Use multiple lines!
        '''
        return desc
    
    def get_image(self):
        return 'room_image_name_CHANGEME.jpg'


## change this classname to match a handler name found in 'startup.py'
class EmptyRoomTemplateHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return EmptyRoomTemplate  ###  CHANGE THIS  ###

# define actions for this room

class MyNewAction1(Action):
    def __init__(self):
        Action.__init__(self, "MyNewAction1")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "MyAction Button Text"
    
    # set cutscene for when arrive in entrance_hall
    def do_action(self,game,room,request):
        set_cutscene("Some Cutscene text to include when someone first enters the room")
        return
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'nextlocation_when_action_is_clicked'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
